home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / usr / sybase / doc / dbbylist.man < prev    next >
Text File  |  1993-04-22  |  4KB  |  111 lines

  1.  
  2.   1                       Version 4.0 -- 5/1/89                 dbbylist
  3.   ______________________________________________________________________
  4.  
  5.   NAME:  dbbylist
  6.  
  7.   FUNCTION:
  8.        Return the bylist for a compute row.
  9.  
  10.   SYNTAX:
  11.        BYTE *dbbylist(dbproc, computeid, size)
  12.  
  13.        DBPROCESS *dbproc;
  14.        int       computeid;
  15.        int       *size;
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.   dbbylist                Version 4.0 -- 5/1/89                        2
  25.   ______________________________________________________________________
  26.  
  27.   COMMENTS:
  28.  
  29.        o dbbylist() returns the bylist for a  compute  row.   (A  SELECT
  30.          statement's COMPUTE clause may contain the keyword BY, followed
  31.          by a list of  columns.   This  list,  known  as  the  "bylist,"
  32.          divides the results into subgroups, based on changing values in
  33.          the specified columns.  The COMPUTE clause's row  aggregate  is
  34.          applied  to  each  subgroup,  generating a compute row for each
  35.          subgroup.)
  36.        o dbresults() must return SUCCEED before  the  application  calls
  37.          this routine.
  38.  
  39.        o Assume the following command has been executed:
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.   3                       Version 4.0 -- 5/1/89                 dbbylist
  47.   ______________________________________________________________________
  48.               select dept, name, year, sales from employee
  49.                 order by dept, name, year
  50.                 compute count(name) by dept,name
  51.  
  52.          The call dbbylist(dbproc, 1, &size) sets  size  to  2,  because
  53.          there  are two items in the bylist.  It returns a pointer to an
  54.          array of two BYTES, which contain the values 1 and 2,  indicat-
  55.          ing  that  the  bylist  is composed of columns 1 and 2 from the
  56.          select-list.
  57.  
  58.   PARAMETERS:
  59.        dbproc -  A pointer to the DBPROCESS structure that provides  the
  60.            connection for a particular front-end/SQL Server process.  It
  61.            contains all the information that DB-Library uses  to  manage
  62.            communications and data between the front end and SQL Server.
  63.        computeid -  The id that identifies the particular compute row of
  64.            interest.   A  SQL SELECT statement may have multiple COMPUTE
  65.  
  66.  
  67.  
  68.   dbbylist                Version 4.0 -- 5/1/89                        4
  69.   ______________________________________________________________________
  70.            clauses, each of which returns a separate compute  row.   The
  71.            computeid  corresponding  to  the  first  COMPUTE clause in a
  72.            SELECT is 1.  The computeid is  returned  by  dbnextrow()  or
  73.            dbgetrow().
  74.        size -  A pointer to an integer, which  dbbylist()  sets  to  the
  75.            number of elements in the bylist.
  76.  
  77.   RETURNS:
  78.        A pointer to an array of BYTEs  containing  the  numbers  of  the
  79.        columns  that  compose the bylist for the specified compute.  The
  80.        array of BYTEs is part of the DBPROCESS, so you must not free it.
  81.        If the computeid is out of range, NULL is returned.
  82.  
  83.        Call dbcolname() to derive the name of a column from its number.
  84.        The size of the array is returned in the size parameter.  A  size
  85.        of 0 indicates that either there is no bylist for this particular
  86.        compute or the computeid is out of range.
  87.  
  88.  
  89.  
  90.   5                       Version 4.0 -- 5/1/89                 dbbylist
  91.   ______________________________________________________________________
  92.  
  93.   SEE ALSO:
  94.        dbadata,  dbadlen,  dbaltlen,  dbalttype,  dbcolname,   dbgetrow,
  95.        dbnextrow
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.